import { _decorator, Component, Label, Node } from 'cc';
import { UserInfo } from '../common/UserInfo';
import { civilRequest } from '../settings/const';

const { ccclass, property } = _decorator;

@ccclass('PalaceCivil')
export class PalaceCivil extends Component {
    @property(Label)
    civil:Label
    @property(Label)
    civilTotal:Label
    @property(Label)
    desc:Label

    start() {

        this.civil.string = UserInfo.instance.villageData.civilAdded + '文明度/天'
        this.civilTotal.string = UserInfo.instance.villageData.user.uInfo.civilAdded + '文明度/天'
    
        let num = civilRequest[UserInfo.instance.villageData.villageObjList.length]
        
        this.desc.string = `你的村庄现在一共有${UserInfo.instance.villageData.user.uInfo.civil}的文明度。如果你需要兴建或者占领一座村庄的话，你需要${num}的文明度。`
    }

  
}


